import java.util.Arrays;

public class middle2576 {

    public static void main(String[] args) {
        middle2576 middle2576 = new middle2576();

    }
    public int maxNumOfMarkedIndices(int[] nums) {
        //排序加滑动窗口
        Arrays.sort(nums);
        //
        int begin = nums.length-1;
        int end = nums.length-1;
        while(begin>=0){
            if(nums[begin]*2 <= nums[end]){
                break;
            }
            begin--;
        }
        if(begin == -1){
            return 0;
        }
        int count = 0;
        for(;begin>=0;begin--){
            if(nums[begin]*2 <= nums[end]){
                count+=2;
                end--;
            }
        }

        return count;

    }
}
